package test3;

/**
 * @Author Jun jie Yi
 * 2022/4/28 18:37
 */

public class Demo6 {
    public static void main(String[] args) {
        int[] arr = {1, 2, 3, 4, 5, 6};
        dispose(arr, 7);
    }

    static void dispose(int[] arr, int target) {
        for (int i = 0; i < arr.length; i++) {
            for (int j = i + 1; j < arr.length; j++) {
                if (arr[i] + arr[j] == target) {
                    System.out.println(arr[i] + ":" +arr[j]);
                }
            }
        }
    }
}
